<html>
<head><meta charset="utf-8"><title>Crate Lockfiles and Examples · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Crate.20Lockfiles.20and.20Examples.html">Crate Lockfiles and Examples</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="210283197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Crate%20Lockfiles%20and%20Examples/near/210283197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Lilienthal <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Crate.20Lockfiles.20and.20Examples.html#210283197">(Sep 16 2020 at 16:00)</a>:</h4>
<p>Here's a question about lockfiles for y'all. I'm working with a library, which means I generally don't want to have <code>Cargo.lock</code> committed to <code>git</code>, however, I also have examples, which require stability in the versions of the linked packages. Is there a good way to commit a lockfile for the development dependencies specifically? Or would it be a good idea for <strong>all</strong> projects to commit their <code>Cargo.lock</code> files?</p>



<a name="210284601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Crate%20Lockfiles%20and%20Examples/near/210284601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Crate.20Lockfiles.20and.20Examples.html#210284601">(Sep 16 2020 at 16:10)</a>:</h4>
<p>My 2c would be to commit the <code>Cargo.lock</code> and add a CI job that does a <code>cargo generate-lockfile</code> before tests.</p>



<a name="210285751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Crate%20Lockfiles%20and%20Examples/near/210285751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Lilienthal <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Crate.20Lockfiles.20and.20Examples.html#210285751">(Sep 16 2020 at 16:20)</a>:</h4>
<p>why would I need to regenerate the lockfile before tests?</p>



<a name="210285975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Crate%20Lockfiles%20and%20Examples/near/210285975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Crate.20Lockfiles.20and.20Examples.html#210285975">(Sep 16 2020 at 16:21)</a>:</h4>
<p>You probably want your library tested with the latest version of your dependencies, as that is what someone that uses your library will get.</p>



<a name="210286835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Crate%20Lockfiles%20and%20Examples/near/210286835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Lilienthal <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Crate.20Lockfiles.20and.20Examples.html#210286835">(Sep 16 2020 at 16:28)</a>:</h4>
<p>I see what you mean. Yea that makes perfect sense to me.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>